package com.example.androiddemo;

import java.util.ArrayList;
import java.util.List;

import android.view.LayoutInflater;
import android.view.View;

import com.ex.views.KAdapter;
import com.example.ui.base.BaseFragment;
import com.iflytek.custom.photo3d.GalleryFlow;

public class GalleryFrg extends BaseFragment{
	private GalleryFlow galleryFlow;
	
	private KAdapter<GalleryItem> adapter;

	@Override
	public int getLayoutId() {
		return R.layout.gallery_layout;
	}

	@Override
	public void initialViews(View root, LayoutInflater inflater) {
		galleryFlow = (GalleryFlow) root.findViewById(R.id.gallery);
		initData();
	}
	
	private void initData() {
		List<GalleryItem> items = new ArrayList<GalleryItem>();
		items.add(new GalleryItem(_instance, R.drawable.first));
		items.add(new GalleryItem(_instance, R.drawable.sec));
//		items.add(new GalleryItem(_instance, R.drawable.coupon_duihuan_bg));
		
		adapter = new KAdapter<GalleryItem>(items);
		galleryFlow.setAdapter(adapter);
		adapter.notifyDataSetChanged();
	}

}
